<!-- 个人中心 -->
<template>
  <div class="personalCenter-container">
    <div class="about">
      <BackgroundBox>
        <div class="title">关于用户</div>
        <div class="main">
          <el-avatar
            :size="100"
            :src="readUserInfo.avatar"
            style="border: 5px solid #bbbbbb"
          />
          <p class="name">{{ readUserInfo.Nickname }}</p>
          <p class="account">{{ readUserInfo.adminId }}</p>
        </div>
      </BackgroundBox>
    </div>
    <div class="info">
      <BackgroundBox>
        <div class="title">
          <span class="text">账号信息</span>
        </div>
        <div class="main">
          <div class="item">
            <Icon type="name"></Icon>
            <p class="label">姓名:</p>
            <p>{{ readUserInfo.Nickname }}</p>
          </div>
          <div class="item">
            <Icon type="accountMan"></Icon>
            <p class="label">账号:</p>
            <p>{{ readUserInfo.adminId }}</p>
          </div>
          <div class="item">
            <Icon type="authority"></Icon>
            <p class="label">权限:</p>
            <p>{{ readUserInfo.authentication ? "管理员" : "超级管理员" }}</p>
          </div>
          <div class="item">
            <Icon type="phone"></Icon>
            <p class="label">手机号:</p>
            <p>{{ readUserInfo.phone }}</p>
          </div>
        </div>
      </BackgroundBox>
    </div>
  </div>
</template>

<script setup>
import BackgroundBox from "@/components/BackgroundBox/index.vue";
import { useUserStore } from "@/store/useUserStore.js";
import { storeToRefs } from "pinia";
import Icon from "@/components/Icon/index.vue";
const { readUserInfo } = storeToRefs(useUserStore());
</script>

<style lang="less" scoped>
@import "@/styles/var.less";
.personalCenter-container {
  width: 100%;
  padding: 20px;
  display: flex;

  .about {
    flex: 1;
    padding-right: 60px;
    height: 300px;
    .title {
      padding: 0 20px;
      height: 60px;
      line-height: 60px;
      border-bottom: 1px solid @Info;
      font-size: 1.2em;
    }
    .main {
      text-align: center;
      padding: 30px 0;
      p {
        margin: 10px 0;
      }
      .name {
        font-size: 1.9em;
        font-weight: bold;
      }
      .account {
        font-size: 1.3em;
      }
    }
  }
  .info {
    flex: 2;
    .back-container {
      padding: 20px;
      .title {
        height: 60px;
        line-height: 60px;
        font-size: 1em;
        font-size: 1.1em;
        border-bottom: 2px solid @Info;
        position: relative;
        span {
          display: block;
          color: @primary;
          border-bottom: 3px solid @primary;
          position: absolute;
          height: 60px;
        }
      }
      .main {
        .item {
          display: flex;
          align-items: center;
          margin: 30px 0;
          font-size: 1.3em;
          .icon-container{
            color: @Info;
            margin-right: 2px;
          }
          .label {
            color: @Info;
          }
          p {
            margin-right: 5px;
          }
        }
      }
    }
  }
}
</style>